package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 石方旭
 * Date: 2022-04-27
 * Time: 17:25
 */
interface IFlying{
    void fly();
}
class Bird implements IFlying{
    private String name = "bird";
    @Override
    public void fly() {
        System.out.println("我是"+this.name+"我会飞~~~~");
    }
}

class Fish implements IFlying{
    private String name = "bird";
    @Override
    public void fly() {
        System.out.println("我是"+this.name+"我会飞~~~~");
    }
}

public class TestDemo {

    public static void main(String[] args) {
        IFlying iFlying = new Bird();
        iFlying.fly();
    }

}
